package pile.customer.config;


import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import pile.customer.componet.OSSProperties;


@Configuration
public class OSSConfig {

    @Autowired
    private OSSProperties ossProperties;

    @Bean
    public OSSClient ossClient(){
        OSS ossClient = new OSSClientBuilder().build(ossProperties.getEndpoint(),
                ossProperties.getAccessKeyId(),
                ossProperties.getAccessKeySecret());
        return (OSSClient) ossClient;
    }
}
